package cn.datawin.cmppclient.service.impl;

import cn.datawin.bms.provider.entity.ProvProviderParamEntity;
import cn.datawin.cmppclient.mapper.ProvProviderParamMapper;
import cn.datawin.cmppclient.service.ProvProviderParamService;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 供应商接入参数表
 *
 * @author datawin-sms
 * @date 2025-08-21 11:29:41
 */
@Service
public class ProvProviderParamServiceImpl extends ServiceImpl<ProvProviderParamMapper, ProvProviderParamEntity> implements ProvProviderParamService {
	/**
	 * 获取供应商参数列表
	 * @param providerIdList 供应商ID列表
	 * @return 供应商参数列表
	 */
	@Override
	public List<ProvProviderParamEntity> getProviderParamList(List<Long> providerIdList) {
		if(CollUtil.isEmpty(providerIdList)) return CollUtil.newArrayList();
		//根据供应商ID列表查询供应商参数列表
		LambdaQueryWrapper<ProvProviderParamEntity> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.in(ProvProviderParamEntity::getProviderId, providerIdList);
		return baseMapper.selectList(queryWrapper);
	}
}
